<?php
	require_once "header.php";
	session_start();

	
	
	$isSuccess = 0;
	
	if(isset($_POST['btn_ok']))
	{
		require_once "trackingModify.php";
		
		$news = new CArticles;
	
		$id_author = $_SESSION['idUser'];	
		$title = $_POST['tf_title'];
		$content = $_POST['tf_content'];
		$source = $_POST['tf_source'];
		//$dateposted =  date("F j, Y, g:i a");      
		$dateposted  = mktime(date('h'), date('i'), date('s'), date("m")  , date("d"), date("Y"));      
		
		$numofview = 0 ; 
		$status = 1 ; 
		$picture = "images/Admin.png";
			
		$isSuccess =$news -> CArticlesAdd($id_author,$title,$content,$picture ,$source,$dateposted,$numofview,$status);	
		
	}
	
	if($isSuccess ==-1)
		echo '<script language="javascript">window.location.href="main.php?jmp=note&to='."'"."addArticles_2"."'".'"</script>';  
	else
		if($isSuccess !=0)
			echo '<script language="javascript">window.location.href="main.php?jmp=note&to='."'"."addArticles_1"."'".'"</script>';  
	
?>